package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.Teacher;
import com.ruoyi.system.mapper.TeacherMapper;
import com.ruoyi.system.service.ITeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 教师信息Service业务层处理
 *
 * @author ruoyi
 * @date 2022-04-27
 */
@Service
public class TeacherServiceImpl implements ITeacherService {
    @Autowired
    private TeacherMapper teacherMapper;

    /**
     * 查询教师信息
     *
     * @param tid 教师信息主键
     * @return 教师信息
     */
    @Override
    public Teacher selectTeacherByTid(Integer tid) {
        return teacherMapper.selectTeacherByTid(tid);
    }

    /**
     * 查询教师信息列表
     *
     * @param teacher 教师信息
     * @return 教师信息
     */
    @Override
    public List<Teacher> selectTeacherList(Teacher teacher) {
        return teacherMapper.selectTeacherList(teacher);
    }

    /**
     * 新增教师信息
     *
     * @param teacher 教师信息
     * @return 结果
     */
    @Override
    public int insertTeacher(Teacher teacher) {
        return teacherMapper.insertTeacher(teacher);
    }

    /**
     * 修改教师信息
     *
     * @param teacher 教师信息
     * @return 结果
     */
    @Override
    public int updateTeacher(Teacher teacher) {
        return teacherMapper.updateTeacher(teacher);
    }

    /**
     * 批量删除教师信息
     *
     * @param tids 需要删除的教师信息主键
     * @return 结果
     */
    @Override
    public int deleteTeacherByTids(Integer[] tids) {
        return teacherMapper.deleteTeacherByTids(tids);
    }

    /**
     * 删除教师信息信息
     *
     * @param tid 教师信息主键
     * @return 结果
     */
    @Override
    public int deleteTeacherByTid(Integer tid) {
        return teacherMapper.deleteTeacherByTid(tid);
    }
}
